package com.iotechn.unimall.app.api.running;

/*
@author kbq
@date  2019/7/4 - 21:36
*/

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.iotechn.unimall.core.annotation.HttpMethod;
import com.iotechn.unimall.core.annotation.HttpOpenApi;
import com.iotechn.unimall.core.annotation.HttpParam;
import com.iotechn.unimall.core.annotation.HttpParamType;
import com.iotechn.unimall.core.annotation.param.NotNull;
import com.iotechn.unimall.core.exception.ServiceException;
import com.iotechn.unimall.data.dto.RunningRecordDTO;

@HttpOpenApi(group = "running.record", description = "跑步作业")
public interface RunningRecordService {

    @HttpMethod(description = "作业列表")
    public Page<RunningRecordDTO> selectPage(@NotNull @HttpParam(name = "userId", type = HttpParamType.USER_ID, description = "用户Id") Long userId,
                                             @HttpParam(name = "pageNo", valueDef = "1", type = HttpParamType.COMMON, description = "分页查询偏移量") Integer pageNo,
                                             @HttpParam(name = "pageSize", valueDef = "10", type = HttpParamType.COMMON, description = "分页查询长度") Integer pageSize);



    @HttpMethod(description = "交作业")
    public Boolean addRecord(
            @NotNull @HttpParam(name = "userId", type = HttpParamType.USER_ID, description = "用户ID") Long userId,
            @NotNull @HttpParam(name = "picUrl", type = HttpParamType.COMMON, description = "图片地址") String picUrl) throws ServiceException;


    @HttpMethod(description = "审批作业")
    public Boolean approvalRecord(
            @NotNull @HttpParam(name = "recordId", type = HttpParamType.COMMON, description = "记录id") Long recordId,
            @NotNull @HttpParam(name = "status", type = HttpParamType.COMMON, description = "状态：1、通过；2、不通过") Integer status,
            @NotNull @HttpParam(name = "userId", type = HttpParamType.USER_ID, description = "用户ID") Long userId) throws ServiceException;

    @HttpMethod(description = "删除作业记录")
    public Boolean deleteRecord(@NotNull @HttpParam(name = "recordId", type = HttpParamType.COMMON, description = "记录id") Long recordId, @NotNull @HttpParam(name = "userId", type = HttpParamType.USER_ID, description = "用户id") Long userId) throws ServiceException;

    @HttpMethod(description = "取消通过的作业记录")
    public Boolean cancelRecord(@NotNull @HttpParam(name = "recordId", type = HttpParamType.COMMON, description = "记录id") Long recordId, @NotNull @HttpParam(name = "userId", type = HttpParamType.USER_ID, description = "用户id") Long userId) throws ServiceException;

    @HttpMethod(description = "清除所有作业记录")
    public Boolean clealAllData(@NotNull @HttpParam(name = "userId", type = HttpParamType.USER_ID, description = "用户id") Long userId) throws ServiceException;

    @HttpMethod(description = "控制交作业是否显示")
    public  Boolean showApplyButton() throws ServiceException;


}
